import type { ApplicationAddRequest, ApplicationListResponse } from "./type"
import { request } from "@/http/axios"

export function createApplicationApi(data: ApplicationAddRequest) {
  return request<ApiResponseData<boolean>>({
    url: "/position/application",
    method: "post",
    data
  })
}

/**
 * 获取用户的申请职位列表
 * @param userId 用户ID
 * @returns 申请职位列表
 */
export function getUserApplicationsApi(userId: number) {
  return request<ApplicationListResponse>({
    url: `/position/application/user/${userId}`,
    method: "get"
  })
}
